<?php

namespace Home\Model;

use Think\Model\RelationModel;

/**
 * News关联模型
 */
class NewsModel extends RelationModel {
    // 关联模型
    protected $_link = array(
        'imgs' => array(
            'mapping_type' => self::HAS_MANY,
            'class_name' => 'NewsImg',
            'foreign_key' => 'news_id',
            'mapping_fields' => 'src'
        )
    );
}
